﻿using DefCore.Mapping;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using DefCore.Core;

namespace DefCore.Actors
{
    public static class ActorFactory
    {
        public static T Create<T>(DungeonPos position)
            where T : Actor
        {
            ConstructorInfo cinfo = typeof(T).GetConstructor(new Type[] { typeof(DungeonPos) });

            if (cinfo == null)
                return null;

            return (T)cinfo.Invoke(new object[] { position });
        }

    }
}
